Closed
Conversation
… multiple return
Add `try` and `try_err` helper functions to `test/common.sh` that capture stdout/stderr and exit code from a single invocation, eliminating duplicate command executions in tests. Convert all existing tests that used the `OUTPUT`/`EXIT_CODE` double-invocation pattern to use the new helpers. Also fixes a pre-existing bug in the `nvm_die_on_prefix` test where ASCII apostrophes were used instead of U+2019 to match nvm.sh output.
Add `--offline` flag to `nvm install` that resolves versions using only locally installed versions and cached downloads. No network calls are made. New helper functions `nvm_ls_cached` and `nvm_offline_version` scan `$NVM_DIR/.cache/bin/` for previously downloaded tarballs. In offline mode, `nvm_download_artifact` returns cached tarballs directly without checksum verification or download attempts. The curl/wget requirement is skipped when `--offline` is set. Supports `--lts` via locally stored LTS alias files.
Colors were lost because `nvm_has_colors` checks `[ -t 1 ]`, which is false inside the `(...) | sort` pipeline in `nvm_list_aliases`. Evaluate `nvm_has_colors` before the pipe and propagate via `NVM_HAS_COLORS`, matching the approach used by `nvm_print_versions`. Bug introduced in 6311a0e.
* Add .circleci/config.yml (#1) * fix:[meta] update security policy; add IRP (#3) * [Fix] `nvm_install_latest_npm`: fix node version detection * v0.40.3 * [meta] update security policy; add IRP --------- Co-authored-by: Toni Viemerö <toni.viemero@iki.fi> Co-authored-by: Jordan Harband <ljharb@gmail.com> * Potential fix for code scanning alert no. 2: Workflow does not contain permissions (#7) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Potential fix for code scanning alert no. 2: Workflow does not contain permissions (#7) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Delete .circleci directory (#13) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Alert autofix 1 (#15) * Delete .circleci directory Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Circleci project setup (#14) * Add .circleci/config.yml * Add .circleci/config.yml * Update config.yml (#18) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Circleci project setup (#24) * Add .circleci/config.yml * Add .circleci/config.yml * Update config.yml (#18) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Toni Viemerö <toni.viemero@iki.fi> Co-authored-by: Jordan Harband <ljharb@gmail.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add .circleci/config.yml (Build node_g for debugging #1)
fix:[meta] update security policy; add IRP (Need to set $NVM_DIR or nvm installs node to root #3)
[Fix]
nvm_install_latest_npm: fix node version detectionv0.40.3
[meta] update security policy; add IRP
Potential fix for code scanning alert no. 2: Workflow does not contain permissions (nvm clone || nvm install head not working #7)
Potential fix for code scanning alert no. 2: Workflow does not contain permissions (nvm clone || nvm install head not working #7)
Delete .circleci directory (
nvm use #{version} --default#13)Alert autofix 1 (ZSH Integration #15)
Delete .circleci directory
Circleci project setup (Sourcing NVM does not work in ZSH #14)
Add .circleci/config.yml
Add .circleci/config.yml
Update config.yml (Don't pollute the START variable #18)
Circleci project setup (Force use of unaliased version of ls from shell #24)
Add .circleci/config.yml
Add .circleci/config.yml
Update config.yml (Don't pollute the START variable #18)